Wandbox API
一覧
GET https://wandbox.org/api/list.json
POST https://wandbox.org/api/compile.json
POST https://wandbox.org/api/compile.ndjson
POST https://wandbox.org/api/permalink
GET https://wandbox.org/api/permalink/:link
GET https://wandbox.org/api/template/:template-name
GET https://wandbox.org/api/user.json?session=:sessionId
code:js
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
code: [
"#include <iostream>",
'int main() { int x = 0; std::cout << "hoge" << std::endl; }',
].join("\n"),
options: "warning,gnu++1y",
compiler: "gcc-head",
"compiler-option-raw": "-Dx=hogefuga\n-O3",
}),
});
for await (const chunk of res.body) {
console.log([Reading] ${JSON.stringify([new TextDecoder().decode(chunk)])});
}
Reference